1. Field of the Invention
The present invention relates to a method for storing data. More particularly, the present invention relates to a method for storing data into a program memory.
2. Description of Related Art
With development of technology, various kinds of electronic products are provided. Correspondingly, commercial competition of electronic industry is increasingly intensive. Besides developing various functional innovations on the products to gain more commercial opportunities, reducing cost of the products is also an indispensable method for enhancing competitiveness of the products.
Since the computer system is increasingly complicated, a large amount of electronic devices such as south bridge chips, north bridge chips, memories, and power supply chips etc. are applied to a motherboard of the computer system. Particularly in aspect of the memories, to cope with functional refinement of the computer system, different kinds of memories such as electrically erasable programmable read-only memories (EEPROMs), and serial peripheral interface read-only memories (SPI ROMs) are applied to the motherboard.
However, the SPI ROM may only be written with “0” (initial value thereof is “1”), and therefore the SPI ROM is generally used for storing program codes of software programs that are seldom changed, and the EEPROM is generally used for storing data that are usually varied.
FIG. 1 is a schematic diagram illustrating a method for accessing a memory of a conventional computer system. Referring to FIG. 1, a computer system 110 may send an instruction to a controller 130 via a low pin count (LPC) bus 120. The controller 130 then assesses a SPI ROM 160 via a serial peripheral interface (SPI) bus 140 or accesses an EEPROM 170 via a system management bus (SM-bus) 150 according to the instruction.
Referring to FIG. 1 again, in such structure, the SPI ROM 160 is functioned as the program memory and generally remains a lot of unused regions due to lack of stored program data, which may cause a waste of memory space. Moreover, the EEPROM 170 used for storing data not only occupies space of the motherboard, but also has a relatively high cost, such that fabrication cost of the product is increased. Accordingly, the structure of the conventional computer system is not economical.